<template>
  <div class="containt">
    <nav-com
      title="联创伙伴"
      :showView='true'
      @back="backHandler()"
    ></nav-com>
    <div class="top-div"></div>
    <div class="all-income">
      <div class="item-3">
        <div>
          <div style="text-align:center; color:#FE4B20; font-size:18px;line-height: 40px;font-weight: 600;">{{dataInfo.total_amount_sum}}元</div>
          <div style="text-align:center;font-size: 15px;">联创总收益</div>
          
        </div>
        <div>
           <div style="text-align:center; color:#FE4B20; font-size:18px;line-height: 40px;font-weight: 600;">{{dataInfo.yestoday_num_sum}}元</div>
          <div style="text-align:center;font-size: 15px;">上月联创总收益</div>
         
        </div> 
      </div>
      <!-- <div class="split"></div> -->
      <div class="detail-income" >
        <div >
          <div style="color:#FE4B20; font-size:16px;font-weight: 600;">{{dataInfo.total_profit}}元</div>
          <div style="font-size:15px; color:#000000; min-width: 100px;">我的总收益</div>
          
        </div>
        <div >
          <div style="color:#FE4B20; font-size:17px;font-weight: 600;">{{dataInfo.today_num}}元</div>
          <div style="font-size:16px; color:#000000; min-width: 100px;">我的当月收益</div>
          
        </div>
        <div >
          <div style="color:#FE4B20; font-size:16px;font-weight: 600;">{{dataInfo.yestoday_num}}元</div>
          <div style="font-size:15px; color:#000000; min-width: 100px;">我的上月收益</div>
          
        </div>
      </div>
    </div>
    <div>
      <img src="../../../assets/my/xwlBg.png" style="width: 90vw;display: flex;margin: 0 auto;" @click="goPage('1')" >
    </div>
    <!-- <div class="order-income" >
      <div class="title">收益记录</div>
      <div v-if="dataInfo.lists.length == 0" style="margin:50px;text-align:center">
          --暂无数据--
        </div>
      <div class="order-list" v-for="item in dataInfo.lists" :key="item.addtime">
        <div>{{item.name}}</div>
        <div style="color:#FE4B20">{{item.total_fee}} ×{{item.goods_num}}</div>
      </div>
    </div> -->
    <div style="width: 86vw;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: rgb(254, 75, 32);
    border-radius: 50px;
    color: rgb(255, 255, 255);
    margin: auto;
    margin-top: 20vh;" @click="goPage('2')">
          我要申请成为联创伙伴
    </div>
  </div>
</template>

<script>
import navCom from "@/component/nav";
import {madeTogehter} from '@/api/api.js'
export default {
  components: {
    navCom,
  },
  data(){
    return{
        dataInfo:{}
    }
  },
  created(){
    this.initData()
  },
  methods: {
    goPage(type){
        if(type==1){
            this.$router.push("/toFuture");
        }
        if(type==2){
          this.$router.push("/togetherInvitation"); 
        }
    },
    //返回
    backHandler() {
      this.$router.go(-1);
      // if(weixin.isAndroid()){
      //   window.JS_TROOPS.goBack()
      // }else{
      //   this.$router.go(-1);
      // }
    },
    // 初始化数据
    initData(){
        madeTogehter().then((res) => {
            if(res.data.code == 1){
                this.dataInfo = res.data.data
            }
        }).catch((err) => {
            
        });
    }
  },
};
</script>

<style scoped>
.split{
    width: .5px;
    height: 100px;
    background: #E5E5E5;
    margin-left: 20px;
}
.containt {
  min-height: 100vh;
  /* height: auto; */
  background: #f2f3f7;

}
.top-div {
  background: url("../../../assets/my/togetherBG.png");
  height: 20vh;
  background-repeat: round;
}
.all-income {
    text-align: centers;
    margin: 5vh auto;
    /* height: 13vh; */
    background: #fff;
    margin-top: -17vh;
    width: 85vw;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 2vh;
    /* display: flex; */
}
.item-3 {
  display: flex;
  justify-content: space-around;

}
.detail-income {
  text-align:center; 
  margin-top: 5vw;
  align-items: center;
  display: flex;
  justify-content: space-between;
  /* margin-top: 2vh; */
  /* flex-direction: column; */
  /* flex: 1.5; */
}
.order-income {
  font-size: 18px;
  font-weight: 700;
  padding:5vw;
}
.order-income .title {
    background: url("../../../assets/my/ad-icon.png") no-repeat;
    background-size: 8% 60%;
    height: 5vh;

}
.order-list {
  margin-top: 1vh;
  display: flex;
  justify-content: space-between;
  background: #fff;
  padding: 0 5vw;
  height: 6.5vh;
  border-radius: 1vh;
  align-items: center;
}
</style>